using UnityEngine;

/// <summary>
/// 窝瓜技能数据
/// </summary>
[CreateAssetMenu(menuName = "创建ScriptableObject/SkillData/Plants/SquashSkillData")]
public class SquashSkillData : SkillData
{
    [Header("攻击属性")]
    [Tooltip("攻击伤害值")]
    public long AttackDamage = 1800;
    
    [Tooltip("攻击范围（半径）")]
    public float AttackRange = 1.0f;
    
    [Tooltip("是否一次性使用")]
    public bool IsOneTimeUse = true;
    
    [Tooltip("攻击延迟时间（秒）")]
    public float AttackDelay = 0.5f;
    
    [Tooltip("跳跃范围")]
    public float JumpRange = 3.0f;
    
    [Tooltip("跳跃目标选择范围（半径）")]
    public float TargetSearchRange = 5.0f;

    private void OnEnable()
    {
        // 窝瓜需要攻击目标
        RequiresTarget = true;
        // 将Range设置为TargetSearchRange，这样AttackComponent.FindEnemy()能正确找到目标
        Range = TargetSearchRange;
    }
}

